package academic.concordia.bankofquebec.dao.payment;

import org.hibernate.SessionFactory;

import academic.concordia.bankofquebec.entity.Bill;
import academic.concordia.bankofquebec.entity.Payment;

public class PaymentDAO implements IPaymentDAO {
	
	private SessionFactory sessionFactory;

	public SessionFactory getSessionFactory() {
		return sessionFactory;
	}

	public void setSessionFactory(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}

	@Override
	public void addPayment(Payment payment) {
		getSessionFactory().getCurrentSession().save(payment);
	}

	@Override
	public void updatePayment(Payment payment) {
		getSessionFactory().getCurrentSession().update(payment);
		
	}

	@Override
	public void deletePayment(Payment payment) {
		getSessionFactory().getCurrentSession().delete(payment);
		
	}

	@Override
	public Bill getPaymentById(String id) {
		// TODO Auto-generated method stub
		return null;
	}
}
